home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / imap / ANSI / c-client / vms_mail.h < prev    next >
C/C++ Source or Header  |  1994-08-02  |  5KB  |  173 lines

  1. /*
  2.  * Program:    VMS_MAIL mail routines
  3.  *
  4.  * Author:    Yehavi Bourvine, The Hebrew University of Jerusalem.
  5.  *        Internet: Yehavi@VMS.huji.ac.il
  6.  *
  7.  * Date:    2 August 1994
  8.  * Last Edited:    2 August 1994
  9.  *
  10.  * Copyright 1994 by the University of Washington
  11.  *
  12.  *  Permission to use, copy, modify, and distribute this software and its
  13.  * documentation for any purpose and without fee is hereby granted, provided
  14.  * that the above copyright notice appears in all copies and that both the
  15.  * above copyright notice and this permission notice appear in supporting
  16.  * documentation, and that the name of the University of Washington not be
  17.  * used in advertising or publicity pertaining to distribution of the software
  18.  * without specific, written prior permission.  This software is made
  19.  * available "as is", and
  20.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  21.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  22.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  23.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  24.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  25.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  26.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  27.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  28.  *
  29.  */
  30.  
  31. #include <maildef.h>
  32.  
  33. /* Standard string descriptor */
  34.  
  35. struct DESC {
  36.   short    length;            /* length of string and descriptor type */
  37.   short type;
  38.   char *address;        /* buffer address */
  39. };
  40.  
  41.  
  42. /* Item list for passing parameters to the mail routines */
  43.  
  44. struct ITEM_LIST {
  45.   short    length;            /* buffer length */
  46.   short code;            /* item/action code */
  47.   char *buffer;            /* input buffer address */
  48.   int *Olength;            /* where to place length of result */
  49. };
  50.  
  51.  
  52. /* Should be in some #include file */
  53.  
  54. extern int mail$mailfile_begin ();
  55. extern int mail$mailfile_end ();
  56. extern int mail$mailfile_open ();
  57. extern int mail$mailfile_close ();
  58. extern int mail$mailfile_info_file ();
  59. extern int mail$message_begin ();
  60. extern int mail$message_end ();
  61. extern int mail$message_select ();
  62. extern int mail$message_get ();
  63.  
  64. /* Command bits, must correspond to mailbox bit values */
  65.  
  66. #define fSEEN 1
  67. #define fDELETED 2
  68. #define fFLAGGED 4
  69. #define fANSWERED 8
  70. #define fOLD 16            /* moby sigh */
  71. #define    fWAS_DELETED 32        /* was really deleted - don't delete again */
  72.  
  73. /* I/O stream local data */
  74.  
  75.  
  76. typedef struct vms_mail_local {
  77.   unsigned int inbox : 1;    /* if this is an INBOX or not */
  78.   int mail_context;        /* MAIL$ routines context */
  79.   unsigned long filesize;    /* file size parsed */
  80.   char *buf;            /* temporary buffer */
  81.   unsigned long buflen;        /* current size of temporary buffer */
  82. } VMSMAILLOCAL;
  83.  
  84.  
  85. /* Convenient access to local data */
  86.  
  87. #define LOCAL ((VMSMAILLOCAL *) stream->local)
  88.  
  89.  
  90. /* Structure to hold the message's text after we read it once and flags */
  91.  
  92. struct message_text_cache {
  93.   int size;            /* the size of the text */
  94.   int flags;            /* i.e. deleted, etc. */
  95.   char *text;            /* the text itself */
  96. } *MessageTextCache;
  97.  
  98. /* Function prototypes */
  99.  
  100. DRIVER *vms_mail_valid  ();
  101. long vms_mail_isvalid  ();
  102. void *vms_mail_parameters  ();
  103. void vms_mail_find  ();
  104. void vms_mail_find_bboards  ();
  105. void vms_mail_find_all  ();
  106. void vms_mail_find_all_bboards  ();
  107. long vms_mail_subscribe  ();
  108. long vms_mail_unsubscribe  ();
  109. long vms_mail_subscribe_bboard  ();
  110. long vms_mail_unsubscribe_bboard  ();
  111. long vms_mail_create  ();
  112. long vms_mail_delete  ();
  113. long vms_mail_rename  ();
  114. MAILSTREAM *vms_mail_open  ();
  115. void vms_mail_close  ();
  116. void vms_mail_fetchfast  ();
  117. void vms_mail_fetchflags  ();
  118. ENVELOPE *vms_mail_fetchstructure  ();
  119. char *vms_mail_fetchheader  ();
  120. char *vms_mail_fetchtext  ();
  121. char *vms_mail_fetchbody  ();
  122. unsigned long vms_mail_header  ();
  123. void vms_mail_setflag  ();
  124. void vms_mail_clearflag  ();
  125. void vms_mail_search  ();
  126. long vms_mail_ping  ();
  127. void vms_mail_check  ();
  128. void vms_mail_snarf  ();
  129. void vms_mail_expunge  ();
  130. long vms_mail_copy  ();
  131. long vms_mail_move  ();
  132. long vms_mail_append  ();
  133. void vms_mail_gc  ();
  134.  
  135. int vms_mail_lock  ();
  136. void vms_mail_unlock  ();
  137. unsigned long vms_mail_size  ();
  138. char *vms_mail_file  ();
  139. short vms_mail_getflags  ();
  140. long vms_mail_parse  ();
  141. long vms_mail_copy_messages  ();
  142. MESSAGECACHE *vms_mail_elt  ();
  143. void vms_mail_update_status  ();
  144. char vms_mail_search_all  ();
  145. char vms_mail_search_answered  ();
  146. char vms_mail_search_deleted  ();
  147. char vms_mail_search_flagged  ();
  148. char vms_mail_search_keyword  ();
  149. char vms_mail_search_new  ();
  150. char vms_mail_search_old  ();
  151. char vms_mail_search_recent  ();
  152. char vms_mail_search_seen  ();
  153. char vms_mail_search_unanswered  ();
  154. char vms_mail_search_undeleted  ();
  155. char vms_mail_search_unflagged  ();
  156. char vms_mail_search_unkeyword  ();
  157. char vms_mail_search_unseen  ();
  158. char vms_mail_search_before  ();
  159. char vms_mail_search_on  ();
  160. char vms_mail_search_since  ();
  161. char vms_mail_search_body  ();
  162. char vms_mail_search_subject  ();
  163. char vms_mail_search_text  ();
  164. char vms_mail_search_bcc  ();
  165. char vms_mail_search_cc  ();
  166. char vms_mail_search_from  ();
  167. char vms_mail_search_to  ();
  168.  
  169. typedef char (*search_t)  ();
  170. search_t vms_mail_search_date  ();
  171. search_t vms_mail_search_flag  ();
  172. search_t vms_mail_search_string  ();
  173.